<template>
  <a-modal
    :open="open"
    :title="title"
    @ok="handleOk"
    :wrap-class-name="wrapClassName"
    :width="width"
    @cancel="handleOk"
  >
    <slot></slot>
    <template #footer>
      <a-button key="submit" type="primary" @click="handleOk">确定</a-button>
    </template>
  </a-modal>
</template>

<script>
export default {
  name: "ModalSlot",
  props: {
    open: {
      type: Boolean,
      default: false,
    },
    title: {
      type: String,
      default: "",
    },
    width: {
      type: Number,
      default: 520,
    },
    wrapClassName: {
      type: String,
      default: "",
    },
  },
  data() {
    return {};
  },

  methods: {
    handleOk() {
      this.$emit("on-handleOk");
    },
  },
};
</script>
